home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1986 March & April
/
rerun-1986-03-04.d64
/
metronome 64
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
5KB
|
190 lines
0 poke808,239:rem disable stop key
10 rem ******************************
11 rem * maelzel's modern metronome *
12 rem * by robert s. owen *
13 rem * dedicated to *
14 rem * jimmy thompson *
15 rem ******************************
100 gosub5000
300 printchr$(150)
310 pokes,0:pokevic+2,136:poke198,0
311 printchr$(19)tab(38)sp$" "
312 printchr$(19)tab(38)tp$"_"
320 gosub7300:geta$:ifa$=""then320
321 ifa$="3"then320
322 ifa$<>chr$(13)then325
324 goto380
325 ifa$<>chr$(141)then330
327 printchr$(19)tab(38)tp$" "
328 goto7000
330 ifa$<"1"ora$>"9"then320
331 t$=a$:printchr$(19)tab(28)tp$chr$(18)t$" "
340 gosub7300:geta$:ifa$=""then340
345 ifa$<"0"ora$>"9"then340
346 ift$="2"thenifa$>"0"then340
350 t$=t$+a$:printchr$(19)tab(28)tp$chr$(18)t$" "
351 ifval(t$)>39then380
360 gosub7300:geta$:ifa$=""then360
365 ifa$<"0"ora$>"9"then360
370 t$=t$+a$
380 printchr$(19)tab(28)tp$chr$(146)t$" "
390 ts=.935*val(t$)+35.6:pokevic+1,ts
395 printchr$(19)tab(38)tp$" "
396 printchr$(19)tab(38)bt$"_"
520 gosub7300:geta$:ifa$=""then520
521 ifa$=chr$(13)then580
525 ifa$<"1"ora$>"8"then520
530 b$=a$:printchr$(19)tab(28)bt$chr$(18)b$"/ "
540 gosub7300:geta$:ifa$=""then540
541 ifa$=chr$(13)then540
545 ifa$<>"1"anda$<>"2"anda$<>"4"anda$<>"8"then540
550 bb$=a$:printchr$(19)tab(28)bt$chr$(146)b$"/"bb$
580 printchr$(19)tab(38)bt$" "
581 printchr$(19)tab(38)gg$"_"
610 gosub7300:geta$:ifa$<>chr$(13)then610
680 printchr$(19)tab(38)gg$" "
681 printchr$(19)tab(38)sp$"_"
1010 tt=(1/val(t$))*(3600-((val(t$)/70)*175)):rem contains a fudge factor
1015 l=136-((1/val(t$))*4760):ifl<17thenl=17
1016 h=136+((1/val(t$))*4760):ifh>255thenh=255
1020 b=val(b$)
1030 ifb=6andbb$="8"thenb=2
1040 ifb=1then2010
1050 ifb=5orb=7thenifbb$>"1"then2050
1060 goto2020
2010 gosub2060:ifpeek(k)=0then2010
2011 goto310
2020 gosub2060:fori=1to(b-1):gosub2080:nexti:ifpeek(k)=0then2020
2021 goto310
2050 ifb=7thengosub2060:gosub2080:ifpeek(k)>0then310
2055 gosub2060:gosub2080:ifpeek(k)>0then310
2057 gosub2060:gosub2080:gosub2080:ifpeek(k)=0then2050
2058 goto310
2060 ti$="000000":gosub7310
2062 ifti<3then2062
2063 pokes,0
2065 ifpeek(k)>0thenreturn
2066 p=peek(spr)+5*d:ifp<lorp>hthenp=peek(spr)
2067 pokespr,p:ifti<ttthen2065
2070 pokes,33:d=d*-1:return
2080 ti$="000000"
2082 ifti<3then2082
2083 pokes,0
2085 ifpeek(k)>0thenreturn
2086 p=peek(spr)+5*d:ifp<lorp>hthenp=peek(spr)
2087 pokespr,p:ifti<ttthen2085
2090 pokes,17:d=d*-1:return
5000 rem **soune set-up**
5010 fori=54272to54300:pokei,0:next
5020 poke54273,200:poke54277,4:poke54296,15
5030 s=54276
5100 rem **sprite set-up**
5110 vic=53248:spr=vic+2:pokevic+32,0:pokevic+33,6:pokevic+27,255
5115 pokevic+39,3:pokevic+40,7
5120 poke2040,13:fori=0to14:poke832+i,255:next:fori=15to62:poke832+i,0:next
5121 poke2041,14:fori=0to32:poke896+i,255:next:fori=33to62:poke896+i,0:next
5130 pokevic+21,3:pokevic,136:pokevic+2,136:pokevic+3,52
5500 rem **initialize variables**
5510 dn$="":rem cursor down in quotes
5511 al$=""
5512 tp$=dn$+al$
5513 bt$=dn$+tp$
5514 gg$=dn$+bt$
5515 sp$=dn$+gg$
5540 d=1:k=198
5550 tn=56328:sc=56329:mn=56330:hr=56331
5560 pokehr,0:pokemn,0:pokesc,0:poketn,0
5570 printchr$(8):rem disable upper/lower case shift
6000 rem **screen set-up**
6010 printchr$(142)chr$(147)tab(32)chr$(18)chr$(144)" 00:00 ";
6020 printchr$(146)chr$(152)spc(15)chr$(193);
6021 printspc(16)chr$(18)chr$(144)" ";:rem eight spaces in quotes
6030 printchr$(146)chr$(144);
6031 fori=1to14:printchr$(163);:nexti
6032 printchr$(152)chr$(18)chr$(169)" ";
6035 printchr$(223)chr$(146)chr$(144);
6036 fori=1to23:printchr$(163);:nexti:printchr$(152);
6040 printspc(3)chr$(154)"grave/largo "chr$(152)chr$(123);
6041 printspc(12)chr$(144)"s"chr$(152)
6050 printspc(9)chr$(154)"lento "chr$(152)chr$(123);
6051 printspc(12)chr$(144)"h "chr$(176)" "chr$(152)"clock"
6060 printspc(8)chr$(154)"adagio "chr$(152)chr$(123);
6061 printspc(12)chr$(144)"i"chr$(195)chr$(179)chr$(152)
6070 printspc(5)chr$(154)"larghetto "chr$(152)chr$(123);
6071 printspc(12)chr$(144)"f "chr$(173)" "chr$(152)"quit"
6080 printspc(7)chr$(154)"andante "chr$(152)chr$(123);
6081 printspc(12)chr$(144)"t"chr$(152)
6090 printspc(5)chr$(154)"andantino "chr$(152)chr$(123);
6091 printspc(12)chr$(144)chr$(94)chr$(152)
6100 printspc(6)chr$(154)"moderato "chr$(152)chr$(123);
6101 printspc(12)chr$(144)chr$(202)chr$(195)chr$(195);
6102 printchr$(195)chr$(195)chr$(195)chr$(201)chr$(152)
6110 printspc(15)chr$(123);
6111 printspc(12)chr$(150)"120"chr$(152)" tempo"
6115 t$="120":pokevic+1,.935*val(t$)+35.6
6120 printspc(4)chr$(154)"allegretto "chr$(152)chr$(123);
6121 printspc(12)chr$(163)chr$(163)chr$(163)
6130 printspc(15)chr$(123)
6140 printspc(7)chr$(154)"allegro "chr$(152)chr$(123)
6150 printspc(15)chr$(123);
6151 printspc(12)chr$(150)"4/4"chr$(152)" beat"
6155 b$="4":bb$="4"
6160 printspc(9)chr$(154)"assai "chr$(152)chr$(123);
6161 printspc(12)chr$(163)chr$(163)chr$(163)
6170 printspc(7)chr$(154)"vivache "chr$(152)chr$(123)
6180 printspc(15)chr$(123)
6190 printspc(15)chr$(123);
6191 printspc(19)"go"
6200 printspc(8)chr$(154)"presto "chr$(152)chr$(123)
6210 printspc(15)chr$(123)
6220 printspc(15)chr$(123)
6230 printspc(3)chr$(154)"prestissimo "chr$(152)chr$(123);
6231 printspc(17)"stop"
6240 printspc(13)chr$(152)chr$(18)chr$(169)" "chr$(127)chr$(146)
6250 printspc(11)chr$(152)chr$(117)chr$(18)" ";:rem seven spaces in quote
6251 printchr$(146)chr$(105)chr$(145);
6999 return
7000 rem **time set routine**
7110 printchr$(19)tab(38)dn$"_"
7120 geta$:ifa$=chr$(13)then7180
7125 ifa$<"/"ora$>"9"then7120
7126 ifa$>"1"thenifa$<":"thenhh=0:th$="0":goto7146
7130 th$=a$:printchr$(19)tab(34)th$" : "
7131 hh=val(a$)*16
7140 geta$:ifa$=<"/"ora$>"9"then7140
7145 ifval(th$+a$)>12then7140
7146 th$=th$+a$:printchr$(19)tab(34)th$": "
7147 hl=val(a$)
7148 pokehr,hh+hl
7150 geta$:ifa$=<"/"ora$>"5"then7150
7155 tm$=a$:printchr$(19)tab(34)th$":"tm$
7156 mh=val(a$)*16
7160 geta$:ifa$=<"/"ora$>"9"then7160
7164 tm$=tm$+a$
7165 printchr$(19)tab(34)chr$(18)chr$(144)th$":"tm$chr$(146)chr$(150)
7166 ml=val(a$)
7167 pokemn,mh+ml
7168 pokesc,0:poketn,0
7180 printchr$(19)tab(38)dn$" "
7181 printchr$(19)tab(38)al$"_"
7200 rem **check quit routine**
7220 gosub7300:geta$:ifa$=""then7220
7230 ifa$=chr$(141)then7500
7240 ifa$=chr$(13)then7260
7250 goto7220
7260 printchr$(19)tab(38)al$" "
7270 goto310
7300 rem **update clock routine**
7310 ifpeek(mn)=(mh*16)+mlthenreturn
7320 hh=(peek(hr)and112)/16:hl=(peek(hr)and15)
7330 mh=(peek(mn)and240)/16:ml=(peek(mn)and15)
7335 du=peek(tn)
7340 printchr$(19)chr$(18)chr$(144)tab(34)chr$(hh+48)chr$(hl+48);
7341 print":"chr$(mh+48)+chr$(ml+48)chr$(146)chr$(150)
7350 return
7500 rem **quit routine**
7510 poke53269,0
7520 printchr$(147)chr$(154):poke53280,14:poke53281,6
7530 printchr$(9):poke808,237
7540 end